let QrcodeTerminal  = require('qrcode-terminal');

module.exports = function (url, code) {
    if (!/201|200/.test(String(code))) {
        const loginUrl = url.replace(/\/qrcode\//, '/l/');
        QrcodeTerminal.generate(loginUrl);
    }
    console.log(`Scan QR Code to login: ${code}\n${url}`)
};